<!DOCTYPE html>
<head xmlns="http://www.w3.org/1999/html">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>用户注册</title>
    <link rel="stylesheet" href="/index.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/layui/2.6.8/css/layui.css">

</head>
<body>
<div class="layui-layout-admin">
    <div class="layui-header layui-bg-green">
        <div class="layui-logo "></div>
    </div>
</div>

<div class="window">
    <h1>欢迎注册</h1>
    <br>
    <form class ="layui-form" method="post" id = "registerform">
        <div class = "layui-form-item" style="...">
            <label class = "layui-form-label">邮&nbsp;&nbsp;&nbsp;&nbsp;箱：</label>
            <div class="layui-input-block">
                <input type="text" name="email" required lay-verify="required|email" placeholder="请输入邮箱"
                       autocomplete="off" class = "layui-input">
            </div>
        </div>
        <div class = "layui-form-item">
            <div style="margin:0 auto;width:200px;">
                <button class="layui-btn" lay-submit="" lay-filter="register_button">注&nbsp;&nbsp;&nbsp;&nbsp;册</button>
            </div>
        </div>
    </form>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/layui/2.6.8/layui.js"></script>
<script>
    layui.use('form', function(){
        var form = layui.form;
        document.getElementById("registerform").action = "/registeraccount";/*后端注册用户*/

        form.on('submit(register_button)', function(data){
            window.alert("已发送到邮箱，请查看密码");
            //return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>

<div class="layui-footer layui-bg-green">
    <span class="layui-breadcrumb" lay-separator="|"></span>
</div>

</body>

</html>
